<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script>
        function changeCode(){
            var imgObj = document.getElementById("codeImg");
            imgObj.src = "/checkCode?"+Math.random();
        }
    </script>
</head>
<body>
    <span style="color: red" th:text="${errorInfo}"></span>
    <form action="/user/login">
        用户名：<input type="text" name="userName"><br>
        密码：<input type="password" name="pwd"><br>
        <img src="/checkCode" id="codeImg">
        <a href="javascript:changeCode()">看不清楚，换一张</a>
        <br>
        请输入验证码：<input type="text" name="userCode"><br>
        <input type="submit" value="登陆">
    </form>
</body>
</html>